package com.smart.model.convert;

import com.smart.model.dtomapper.ProjectFileTaskInstanceDtoMapper;
import com.smart.model.domain.ProjectFileTaskInstanceDO;
import com.smart.model.vo.ProjectFileTaskInstanceVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class ProjectFileTaskInstanceConvert {

    public static List<ProjectFileTaskInstanceVO> buildProjectFileTaskInstanceVoList(List<ProjectFileTaskInstanceDO> projectFileTaskInstanceDOList) {
        if (CollectionUtils.isEmpty(projectFileTaskInstanceDOList)) {
            return Lists.newArrayList();
        }
        List<ProjectFileTaskInstanceVO> projectFileTaskInstanceVOList = new ArrayList<>();
        for (ProjectFileTaskInstanceDO projectFileTaskInstanceDO : projectFileTaskInstanceDOList) {
            projectFileTaskInstanceVOList.add(ProjectFileTaskInstanceDtoMapper.INSTANCE.do2VO(projectFileTaskInstanceDO));
        }

        return projectFileTaskInstanceVOList;
    }
}
